/*
 * File Name: RenderizadorCelda.java
 * Created on: Dic 26, 2007, 10:06 AM
 */

package co.edu.uniandes.intercon.client.gui.cell;

import java.awt.Component;

import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 * Render used to show in different colors the row of a grid
 * @author Fabian Gutierrez [fagossa@gmail.com]
 * 
 * @see suncertify.gui.common.renderer.RendererHelper#changeColors(JComponent, JTable, int)
 */
public class ColorCellRenderer extends DefaultTableCellRenderer {
    
    /**     
     * @see DefaultTableCellRenderer#getTableCellRendererComponent(JTable,Object, boolean, boolean, int, int)
     */
    @Override
    public Component getTableCellRendererComponent( JTable table,
            Object value, boolean isSelected, boolean hasfocus,
            int i, int j) {
        
        setText(String.valueOf(value));        
        RendererHelper.changeColors(this, table, i);
        
        return this;
    }
    
   
    
}
